﻿#include "plcconfigadd.h"
#include "ui_plcconfigadd.h"

PlcConfigAdd::PlcConfigAdd(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PlcConfigAdd)
{
    ui->setupUi(this);
    ui->buttonBox->button(QDialogButtonBox::Ok)->setText("确定");
    ui->buttonBox->button(QDialogButtonBox::Cancel)->setText("取消");
}

PlcConfigAdd::~PlcConfigAdd()
{
    delete ui;
}

void PlcConfigAdd::on_buttonBox_clicked(QAbstractButton *button)
{
    if(button == static_cast<QAbstractButton *>(ui->buttonBox->button(QDialogButtonBox::Ok)))
        {
            this->close();
        }
        else if(button == ui->buttonBox->button(QDialogButtonBox::Cancel))
        {
            this->close();
        }
}
